program SelectionSort;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  arr : array of integer;
  i, t, n, j : Integer;

begin
  Readln (n);
  SetLength (arr, n);
  Randomize;
  for i := 0 to n-1 do
  begin
    arr[i] := Random (n);
    write (arr[i], ' ');
  end;
  readln;


  for i:= 0 to n - 1 do
    for j := i+1 to n - 1 do
      if (arr[i]>arr[j]) then
      begin
        t:=arr[i];
        arr[i]:= arr[j];
        arr[j]:= t;
      end;


   for i := 0 to n-1 do
     write (arr[i], ' ');
     Readln;


end.